<?php
require '../database.inc.php';
require '../MessageRepository.php';
require '../UserRepository.php';

header('Content-type: application/json');
$messageId = $_POST['messageId'];
$userRepository = new UserRepository();
$messageRepository = new MessageRepository();
$messageRepository->deleteMessage($db, $messageId);
$data = array('messageId' => $messageId);
$json = json_encode($data);
echo $json;
?>
